using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ShopOnline_Bbs : BaseUserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataSet ds = BaseAccess.GetDataSet(base.Connection,
                "select top 1 Subject, DocumentContent from T_Document where Published=1 and CategoryID='bbs' Order by CreateDate desc");
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                ViewState["Subject"] = row["Subject"].ToString();
                ViewState["DocumentContent"] = row["DocumentContent"].ToString();
            }
            else
            {
                this.Controls.Clear();
            }
        }
    }

    protected string GetSubject()
    {
        return ViewState["Subject"].ToString();
    }

    protected string GetContent()
    {
        return ViewState["DocumentContent"].ToString();
    }
}
